@media print
{
  @page:right
  {
    @bottom-right {
      content:  counter(page);
    }
  }

  @page:left
  {
    @bottom-left {
      content:  counter(page);
    }
  }

  @page {
    @top-center {
      content:  string(booktitle);
    }

    @bottom-center {
      content:  string(ch1);
    }
  }

  div.booktitle {
    string-set: booktitle content();
  }

  h1 {
    string-set: ch1 content();
  }

  /* -- section: elements' fonts -- */

  :root {
    font-family:
      TeX Gyre Termes, FreeSerif,
      Times New Roman, serif;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family:
      TeX Gyre Heros, FreeSans,
      Helvetica, Arial, sans-serif;
  }

  pre, code, kbd, samp {
    font-family:
      TeX Gyre Cursor, FreeMono,
      Courier New, monospace;
  }

  /* -- begin: paragraph numbering -- */

  body > p, body > pre,
  main > p, main > pre {
    counter-increment:  paragraph-cnt;
    position:           relative;
  }

  body > p::before, body > pre::before,
  main > p::before, main > pre::before {
    content:      counter(paragraph-cnt);
    font-family:  Times New Roman, serif;
    font-size:    8pt;
    text-align:   right;
    display:      block;
    position:     absolute;
    left:         -12mm;
    width:        10mm;
    height:       100%;
  }
}
